import {Service} from "adajs";
import ImageList from "../../../controls/lists/image";

const MAP = {
    "/my/course/show": {siteId: "cyjlgb", columnId: "COLUMN_BOOK_DRAW"},
    "/my/course/school": {siteId: "cyjlgb", columnId: "COLUMN_STU_STYLE"},
    "/my/course/works": {siteId: "cyjlgb", columnId: "COLUMN_BOOK_DRAW"},
    "/admin/course/show": {siteId: "cyjlgb", columnId: "COLUMN_BOOK_DRAW"},
    "/admin/course/school": {siteId: "cyjlgb", columnId: "COLUMN_STU_STYLE"},
    "/admin/course/works": {siteId: "cyjlgb", columnId: "COLUMN_BOOK_DRAW"}
};

console.log(MAP[window.location.pathname]);

class LodgeService extends Service {
    defaultData() {
        return {
            title: "设置",
            list: {
                url: "/api/cms/cmsArticle/queryPage",
                type: ImageList,
                parameter: MAP[window.location.pathname]
            }
        };
    }

    onupdate(current, data) {
        Object.assign(current, data);
    }
}

export default LodgeService;